﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace System.Windows.Media.Media3D10
{
    public static class Math10
    {
        public static TResult Sum<TResult>(int kmin, int kmax, Func<int, TResult> operation) where TResult : struct, IComparable<TResult>
        {
            dynamic sum, result;
            sum = default(TResult);
            for (int k = kmin; k <= kmax; k++)
            {
                result = operation(k);
                sum += result;
            }
            return sum;
        }

        public static Complex ComplexExp(double x, double y)
        {
            return new Complex(x * Math.Cos(y), x * Math.Sin(y));
        }
    }
}
